﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace RazorBridge
{
    internal class ResourceCacheProvider
    {
        public static readonly ResourceCacheProvider CurrentInstance = new ResourceCacheProvider();

        private Dictionary<string, Stream> m_ResourceFiles = new Dictionary<string, Stream>();

        public void TryCacheResource(string key, Stream resource)
        {
            this.m_ResourceFiles[key] = resource;
        }

        public Stream TryGetCachedResource(string key)
        {
            Stream objStream = null;
            if (this.m_ResourceFiles.ContainsKey(key))
            {
                objStream = this.m_ResourceFiles[key];
            }
            return objStream;
        }
        
    }
}
